This week on Perl 6 (week ending 2002-07-21)

Another week, another Perl 6 summary. Cunningly this week I have taken over the summary from Piers in order to make it easier for me to namecheck myself. It’s been a good week too, with more happening in perl6-internals than perl6-language. So that’s where I’ll start…

Parrot 0.0.7

The big news for this week is that DrForr has released Parrot 0.0.7 to the world (strange that lots of open source projects are releasing code just before the O’Reilly Open Source conference…). This release contains a Perl 6 grammar (with small, partial compiler!), functional subroutine, coroutine and continuation PMCs, global variables, an intermediate code compiler (imcc), a pure-Perl assembler and working garbage collection. “The name is Parrot. Percy Parrot.”

http://archive.develooper.com/perl6-internals@perl.org/msg11090.html http://www.cpan.org/modules/by-authors/id/J/JG/JGOFF/parrot-0_0_7.tgz

Note that the really cool Perl 6 compiler needs at least Perl 5.6. Oh, and check out imcc if you haven’t looked at it yet.

Retro Perl

Nicholas Clark stated that “In October 2000 I believed that 5.005 maintenance *is* important for the acceptance of perl6, and I still do now”. A first patch to the preliminary Perl 6 compiler was sent by Leopold Toetsch to make it work on 5.005_03 and seeing as Chip Salzenberg has restarted work on a new maintenance release of Perl 5.005 it’s probably good for various parts of Parrot to run on retro perls. Shouldn’t be a major problem.

Parrot docs

One of the big pushes last week was for more documentation inside Parrot. Writing documentation is always a problem for an open source project and it hit the wall last week. The good news is that lots of new documentation has been added to Parrot.

There was some discussion on the nature of documentation. The result is that inline C documention should write up API details and that longer discussions (say, the choice of algorithms, how to avoid overflows in unsigned arithmetic, the pros and cons of differing hash algorithms) would end up as .dev files inside the docs/dev/ directory, much as PDD07 “Conventions and Guidelines for Perl Source Code” says. A few more documentation patches followed.

Recently the mailing list and IRC channel have been quite busy and it seems like the new push for more documentation has attracted new people. Bonus!

http://archive.develooper.com/perl6-internals@perl.org/msg11080.html

MANIFESTations

The Parrot MANIFEST file tends not to be kept up-to-date with recent additions. Andy Dougherty produced a patch to do this. Nicholas Clark asked: “Is CVS flexible enough to let us run a manifest check on each commit and generate warnings that get sent somewhere useful if it fails?”. Robert Spier answered that it could and with any luck he’ll get it in soon…

RECALL

Tanton Gibbs posted a patch to clean up a problem with our Copy on Write strategy. He kindly explained it for me: “The basic problem is that in perlint.pmc we have something like:

  void set_string( PMC* value ) {
    CHANGE_TYPE( SELF, PerlString );
    SELF->data = value->data
  }

In other words implement a COW strategy after being changed into a PerlString. However, in perlstring.pmc the following is performed:

  void set_string( PMC* value ) {
    SELF->data = string_copy( INTERP, value->data );
  }

The RECALL command automates that so that set_string now looks like:

  void set_string( PMC* value ) {
    CHANGE_TYPE( pmc, PerlString );
    RECALL;
  }

Thanks to Tanton for explaining.

Internals misc

There were also lots of other small patches and discussions. It looks like the push for this week is to make it easier to add new PMCs to Parrot.

Meanwhile, in perl6-language

It was a quiet week in the perl6-language list, which is probably a good thing as thinking too much about hyper operators makes my head hurt.

Hyper operators

There was some discussion on hyper operators this week. It didn’t go anywhere in particular, but discussed lots of syntax. Objections such as “this code looks ugly!” came up regularly when talking about code such as:

  @solution =  (^-@b + sqrt(@b^**2 ^+ 4^*@a^*@c) ) ^/ (2^*@a);

Luke Palmer pointed out that it might be better expressed as:

  for @a; @b; @c; @s is rw ->
    $a; $b; $c; $s {
      $s = (-$b + sqrt($b**2 - 4*$a*$c)) / (2*$a)
  }

Karl Glazebrook explained that PDL keeps everything as objects and does hyper operator magic without additional syntax. So Perl 6 “@y = $a ^* @x ^+ @b” happens in PDL with the clearer “$y = $a * $x + $b”. Isn’t PDL shiny?

Whitespace?

Brent Dax noticed that there might be a problem with the regular expression modifier “:w”. The words modifier, according to Apocalypse 5 , “causes an implicit match of whitespace wherever there’s literal whitespace in a pattern”. He asked what the following expand to:

  m:w/foo [~|bar]/
  m:w/[~|bar] foo/
  m:w/[~|bar] [^|baz]/
  m:w/@foo @bar/

Luke Palmer expanded that “In other words, it replaces every sequence of actual whitespace in the pattern with a \s+ (between two identifiers) or a \s* (between anything else)“. Thus, the first would expand to:

  m/ foo \s* [~ | bar] /

However, it’s not easy to represent, as the later cases point out. He continues: “Perhaps :w wouldn’t transform the rexex, but keep ‘markers’ on where there was whitespace in the regex”. Nevertheless, it’s a very useful feature.

Acknowledgements

This summary was brought to you from the O’Reilly Open Source conference and with the music from the intro to Buffy the Vampire Slayer.

As Piers says: Once again, if you liked this, then give money to YAS, if you didn’t like it, well, then you can still give them money; maybe they’ll use it to hire a better writer. Or maybe you could write a competing summary.

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub